﻿@using Model;
@{
    ViewBag.Title = "文件列表";
    ViewBag.UploadCss = "active";
    ReturnMessages_Page rm = ViewBag.mess;
    List<Blog_Upload> list = (List<Blog_Upload>)rm.rows;
}

<ul class="breadcrumb">
    <li>上传文件管理<span class="divider">/</span></li>
    <li class="active">@ViewBag.Title</li>
</ul>
<div class="container-fluid">
    <div class="row-fluid">

        <div class="row-fluid">

            <div class="btn-toolbar">
                @*<a class="btn" href="/AdminBlog/Add"><i class="fa fa-plus"></i> 新增</a>*@


                <div class="btn-group">
                    <form class="form-inline" method="get" action="/Admin/BlogUpload/List">
                        <input type="text" class="form-control" name="blogid_search" id="blogid_search" placeholder="用户编号" value="@ViewBag.blogid_search">
                        <button type="submit" class="btn"><i class="fa fa-search"></i> 查询</button>
                    </form>
                </div>

            </div>
            <div class="well">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th style="width:100px;">编号</th>
                            <th style="width:100px;">用户编号</th>
                            <th style="width:80px;">文件大小(kb)</th>
                            <th style="width:100px;">名称</th>
                            <th style="width:100px;">原名称</th>
                            <th style="width:100px;">类型</th>
                            <th style="width:100px;">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in list)
                        {
                            <tr>
                                <td>@item.ul_id</td>
                                <td>@item.ul_memid</td>
                                <td>@item.ul_size</td>
                                <td>@item.ul_name</td>
                                <td>@item.ul_sourcename</td>
                                <td>@item.ul_mimetype</td>
                                <td>
                                    <a class="btn btn-danger" onclick="del('@item.ul_id')"><i class="fa fa-trash-o"></i> 删除</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
            @Html.Raw(Common.MyHtmlHelper.ShowPageNavigate(ViewBag.request_url,rm.pageindex, ViewBag.pageCount, rm.total, (string)ViewBag.search_url))

        </div>



        @Html.Partial("_footer")

    </div>
</div>
<script>
    function del(id)
    {
        ConfirmDialog('确定要删除这条数据？', function () {
            AjaxGet('/Admin/BlogUpload/Delete', { 'id': id }, function (mess) {
                AlertDialog(mess.msg, function () {
                    if (mess.code==200) {
                        location.href = "/Admin/BlogUpload/List";
                    }
                });
            });
        });
    }
</script>